package com.hue.springbootschedule.schedule;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 设置定时任务
 */
@Component
@Slf4j
public class TestSchedule {
    /**
     * 每个时刻的0秒启动，每隔2秒执行一次
     */
    @Scheduled(cron = "1 * * * * ?")
    public void timer() {
        log.info("hello world!");
    }
}
